<template>
	<view>
		<navbar :title="result.title" />
		<view class="pr-main">
			<u-gap height="300rpx"></u-gap>
			<image v-if="result.pay" src="https://mall-admin.xinjiafu.net/mini-static/images/common/6.png" />
			<image v-else src="https://mall-admin.xinjiafu.net/mini-static/images/common/7.png" />
			<view>{{result.text}}</view>
		</view>
	</view>
</template>

<script setup>
	import {
		reactive
	} from "vue";
	import {
		onLoad,
		onShow
	} from "@dcloudio/uni-app"
	import navbar from "@/components/navbar.vue"

	const result = reactive({
		type: 1, // 1 积分 2 金额
		title: "",
		pay: true,
		text: ""
	})

	onLoad((option) => {
		result.type = option.type
		if (option.type === '1') result.title = "积分兑换"
		else result.title = "金额支付"

		if (option.status === 'true') {
			result.pay = true;
			if (option.type === '1') result.text = "兑换成功"
			else result.text = "支付成功"
		} else {
			result.pay = false;
			if (option.type === '1') result.text = "兑换失败"
			else result.text = "支付失败"
		}
	})
</script>

<style>
	page {
		background: #F8F3E7;
	}
</style>
<style scoped lang="scss">
	.pr-main {
		text-align: center;

		view {
			margin-top: 32rpx;
			font-size: 40rpx;
			font-weight: 400;
			color: rgba(64, 3, 3, 1);

		}

		image {
			width: 256rpx;
			height: 256rpx;
		}
	}
</style>